<template>
    <rx-layout>
        <div slot="center" style>
            <rx-grid
                ref="table"
                :allowRowSelect="false"
                :multiSelect="false"
                :columns="columns"
                url="/api-form/form/core/formDownloadRecord/query"
                :queryParam="queryParam"
                data-field="result.data"
                :showPage="false"
                id-field="id"
                @selectChange="onSelectChange"
            >
            </rx-grid>
        </div>
    </rx-layout>
</template>

<script>
import FormDownloadRecordApi from '@/api/form/core/formDownloadRecord'
import FormDownloadRecordEdit from './FormDownloadRecordEdit'
import {BaseList, RxFit, RxGrid} from "@lowcode/jpaas-common-lib";

export default {
    name: 'FormDownloadRecordList',
    mixins: [BaseList],
    components: {
        RxFit
    },
    props:["selectGenTaskId"],
    data() {
        return {
            columns: [
                {
                    title: this.$ti18('rxList.index','序号'),
                    type: 'indexColumn',
                    width: '20%',
                    dataIndex: 'serial',
                    scopedSlots: {customRender: 'serial'}
                },
                {title: this.i18n('form.downloader','下载人'), dataIndex: 'createByName', width: '30%'},
                {title: this.i18n('form.downloadTime','下载时间'), dataIndex: 'createTime', width: '50%'}
            ],
            component: FormDownloadRecordEdit,
            comment: this.i18n('list.comment','Excel下载记录(异步)'),
            widthHeight: ['800px', '600px'],
            fitSearch: false,
        }
    },
    created() {
        if(this.selectGenTaskId){
            this.queryParam["Q_GEN_RECORD__S_EQ"]=this.selectGenTaskId;
        }
    },
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"FormDownloadRecord",key);
        },
        delById(ids) {
            return FormDownloadRecordApi.del({ids: ids.join(',')});
        },
        getListByParams(parameter) {
            return FormDownloadRecordApi.query(parameter)
        }

    },
    watch:{
        "selectGenTaskId":function (val,oldval){

            if(!val){
                return;
            }
            this.queryParam["Q_GEN_RECORD__S_EQ"]=val;
            this.$refs.table.loadData()
        }
    }
}
</script>
<style scoped>

</style>

